﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="uc_main_center.ascx.cs" Inherits="uc_main_center" %>
<%@ Register Assembly="ESWebFramework.I18N" Namespace="ESWebFramework.I18N" TagPrefix="eswf" %>
<style>
.panel
{
    width:142px;height:21px;background-color:#ffffff;border-radius: 5px;text-align:center;padding-top:3px;margin:3px;font-weight:bold;float:left;
    cursor:pointer;
}
.search_panel
{
    background-color:#bd0100;
    border-radius: 5px;
    width:145px;
}
</style>
<script>
    var selectedAppType = 164;
    var selectedCompType = 164;
    $(document).ready(function () {
        // Datepicker
        $('#<%=tb_date.ClientID%>').datepicker({ dateFormat: 'dd/mm/yy' });
        LoadVehicleType(164);
        //window.setTimeout(LoadVehicleType, 5000);
    });
    function Select(panel, id) {
        if (panel == 1) {
            $("#pln_roadway").css("background-color", "#ffffff");
            $("#pln_seaway").css("background-color", "#ffffff");
            $("#pln_airway").css("background-color", "#ffffff");
            $("#pln_railway").css("background-color", "#ffffff");
            switch (id) {
                case 164:
                    $("#pln_roadway").css("background-color", "#bd0100");
                    break;
                case 165:
                    $("#pln_seaway").css("background-color", "#bd0100");
                    break;
                case 167:
                    $("#pln_airway").css("background-color", "#bd0100");
                    break;
                case 166:
                    $("#pln_railway").css("background-color", "#bd0100");
                    break;
            }
            LoadVehicleType(id);
        }
        else {
            $("#pnl_roadway1").css("background-color", "#ffffff");
            $("#pnl_seaway1").css("background-color", "#ffffff");
            $("#pnl_airway1").css("background-color", "#ffffff");
            $("#pnl_railway1").css("background-color", "#ffffff");
            switch (id) {
                case 57:
                    $("#pnl_roadway1").css("background-color", "#bd0100");
                    break;
                case 58:
                    $("#pnl_seaway1").css("background-color", "#bd0100");
                    break;
                case 60:
                    $("#pnl_airway1").css("background-color", "#bd0100");
                    break;
                case 59:
                    $("#pnl_railway1").css("background-color", "#bd0100");
                    break;
            }
            selectedCompType = id;
        }
    }
    function LoadVehicleType(id) {
        if (id == undefined)
            id = 164;
        $('#<%=ddl_vehicleType.ClientID%>').html('');
        var vehicle_types = new Array();
        vehicle_types[166] = 13;
        vehicle_types[164] = 14;
        vehicle_types[165] = 3;
        vehicle_types[167] = 1;

        $.ajax({
            url: "admin/webservice/UniversalType.asmx/getUniverTypeByType",
            data: '{typeid: ' + vehicle_types[id] + ',language_id:<%=this.LangId%>}',
            dataType: "json",
            async: false,
            contentType: "application/json; charset=utf-8",
            type: "POST",
            complete: function (json1) {
                var c = JSON.parse(json1.responseText);
                var d = JSON.parse(c.d);
                $('<option value="0"></option>').appendTo('#<%=ddl_vehicleType.ClientID%>')
                for (var i in d) {

                    $('<option value="' + i + '">' + d[i] + '</option>').appendTo('#<%=ddl_vehicleType.ClientID%>');
                }
            }
        });
    }

    function RedirectCompanySearch() {
        window.location = "Company.aspx?name=" + $('#<%=tbCompany.ClientID%>').val() + "&ttype=" + selectedCompType + "&catid=" + $('#<%=ddl_CompanyType.ClientID%>').val() + "&countryid=" + $('#<%=dd_country.ClientID%>').val();
    }
    function RedirectAppSearch() {
        window.location = "application.aspx?search=true&typeid=" + selectedAppType + "&offerid=" + $('#<%=ddl_type_offer.ClientID%>').val() + "&postcode=" + $('#<%=tb_postCode.ClientID%>').val() + "&vehicle_type=" + $('#<%=ddl_vehicleType.ClientID%>').val() + "&placement_type=" + $('#<%=ddl_placementType.ClientID%>').val() + "&country=" + $('#<%=ddl_country.ClientID%>').val();
    }
</script>
<div id="main_center">
<div id="main_top" style="width:727px;height:202px;background-color:#828385; border-radius: 5px;margin-top:3px;display:none">
&nbsp;
    <div style="width: 100%; text-align:center">
        <div id="Div1" style="width:50px;float:left">&nbsp;</div>    
        <div id="pln_roadway" class="panel" style="background-color:#bd0100;" onclick="Select(1,164)">ROADWAY</div>    
        <div id="pln_seaway" class="panel" onclick="Select(1,165)">SEAWAY</div>    
        <div id="pln_airway" class="panel" onclick="Select(1,167)">AIRWAY</div>    
        <div id="pln_railway" class="panel" onclick="Select(1,166)">RAILWAY</div>    
    </div>
    <div style="clear:both"></div>
    <div style="padding-top:10px">
    <table cellpadding="4" cellspacing="4" border="0" style="text-align:left;background-color:#fff;width:98%;font-weight:bold">
        <tr>
            <td width="30%">
                <eswf:ESi18nLabel ID="ESi18nLabel2" CssClass="lblsrc" TextReference="type_offer" runat="server"></eswf:ESi18nLabel>
                <asp:DropDownList ID="ddl_type_offer" CssClass="form_select" runat="server">
                </asp:DropDownList>
            </td>
            <td width="30%">
                <eswf:ESi18nLabel ID="ESi18nLabel4" CssClass="lblsrc" TextReference="country" runat="server"></eswf:ESi18nLabel>
                <br />
                <asp:DropDownList ID="ddl_country" CssClass="form_select" runat="server">
                </asp:DropDownList>
            </td>
            <td width="30%">
                <eswf:ESi18nLabel ID="ESi18nLabel5" CssClass="lblsrc" TextReference="post_code" runat="server"></eswf:ESi18nLabel>
                <br />
                <asp:TextBox ID="tb_postCode" Width="165px"  CssClass="form_select" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td width="30%">
                <eswf:ESi18nLabel ID="ESi18nLabel6" CssClass="lblsrc" TextReference="vehicle_type" runat="server"></eswf:ESi18nLabel>
                <br />
                <asp:DropDownList ID="ddl_vehicleType" CssClass="form_select" runat="server">
                </asp:DropDownList>
            </td>
            <td width="30%">
                <eswf:ESi18nLabel ID="ESi18nLabel3" CssClass="lblsrc" TextReference="placement_type" runat="server"></eswf:ESi18nLabel>
                <br />
                <asp:DropDownList ID="ddl_placementType" CssClass="form_select" runat="server">
                </asp:DropDownList>
            </td>
            <td width="30%">
                <eswf:ESi18nLabel ID="ESi18nLabel8" CssClass="lblsrc" TextReference="date" runat="server"></eswf:ESi18nLabel>
                <br />
                <asp:TextBox ID="tb_date" ReadOnly="true" Width="165px"  CssClass="form_select" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td style="padding-left:38px;padding-top:10px">
            <input type="button" class="search_panel" name="Search" value="<%=DAO.TextBaseFactory.loadText("search", this.LangId) %>" onclick="RedirectAppSearch()" />
            </td>
        </tr>
    </table>
    </div>
</div>
<%--<br />--%>
<div id="Div2" style="width:727px;height:164px;background-color:#828385; border-radius: 5px;margin-top:3px;display:none">
&nbsp;
<div style="width: 100%; text-align:center">
        <div id="Div3" style="width:50px;float:left">&nbsp;</div>    
        <div id="pnl_roadway1" class="panel" style="background-color:#bd0100;" onclick="Select(2,57)">ROADWAY</div>    
        <div id="pnl_seaway1" class="panel" onclick="Select(2,58)">SEAWAY</div>    
        <div id="pnl_airway1" class="panel" onclick="Select(2,60)">AIRWAY</div>    
        <div id="pnl_railway1" class="panel" onclick="Select(2,59)">RAILWAY</div>    
    </div>
    <div style="clear:both"></div>
    <div style="padding-top:10px">
    <table cellpadding="4" cellspacing="4" border="0" style="text-align:left;background-color:#fff;width:98%;font-weight:bold">
        <tr>
            <td width="30%">
             <eswf:ESi18nLabel ID="ESi18nLabel7" CssClass="lblsrc" TextReference="comp_name" runat="server"></eswf:ESi18nLabel>
             <br />
             <asp:TextBox ID="tbCompany" CssClass="form_select" Width="165px" runat="server"></asp:TextBox>   
            </td>
            <td width="30%">
             <eswf:ESi18nLabel ID="ESi18nLabel9" CssClass="lblsrc" TextReference="country" runat="server"></eswf:ESi18nLabel>
             <br />
             <asp:DropDownList ID="dd_country" CssClass="form_select" runat="server">
             </asp:DropDownList>
            </td>
            <td width="30%">
             <eswf:ESi18nLabel ID="ESi18nLabel10" CssClass="lblsrc" TextReference="company_type" runat="server"></eswf:ESi18nLabel>
             <br />
             <asp:DropDownList ID="ddl_CompanyType" CssClass="form_select" runat="server">
             </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td style="padding-left:38px;padding-top:10px">
            <input type="button" class="search_panel" name="Search" value="<%=DAO.TextBaseFactory.loadText("search", this.LangId) %>" onclick="RedirectCompanySearch()" />
            </td>
        </tr>
    </table>
    </div>
</div>
<%--<br />--%>
    <div class="main_top">
        <eswf:ESi18nLabel ID="ESi18nLabel1" TextReference="welcome_msg" CssClass="_bold" runat="server"></eswf:ESi18nLabel>
    </div>
    <div class="main_content">
        <div style="width:95%;text-align:left">
            <asp:Label ID="lblText" runat="server" Text="Label"></asp:Label>
        </div>
    </div>
    <div class="main_top" style="text-transform:uppercase;font-size:14px;">
    </div>
</div>